package org.suyafei.utils;

import org.apache.shardingsphere.core.strategy.keygen.SnowflakeShardingKeyGenerator;

/**
 * @author 宿某人
 * @Date: 2021/12/12/9:55 下午
 * @Description:
 */
public class IDUtil {

    private static SnowflakeShardingKeyGenerator snowflakeShardingKeyGenerator = new SnowflakeShardingKeyGenerator();

    /**
     * 雪花算法生成器
     * @return
     */
    public static Long geneSnoFlakeId() {
        return Long.valueOf(snowflakeShardingKeyGenerator.generateKey().toString());
    }
}
